# AfD-specific findings
stayer_microm_ames <- rio::import("est/stayer_analyses_microm_marginal_effects_main.csv")
stayer_microm_desc <- rio::import("est/stayer_analyses_microm_descriptives_main.csv")
stayer_microm_info <-
  rio::import("est/stayer_analyses_microm_model_info_main.csv") %>%
  dplyr::mutate(spec = dplyr::case_when(
    is.na(spec) ~ "All",
    spec == "ltr_since_3 == 0" ~ "Moved last 3", 
    spec == "ltr_since_5 == 0" ~ "Moved last 5", 
    spec == "ltr_since_3 == 1" ~ "Since 3", 
    spec == "ltr_since_5 == 1" ~ "Since 5"
  ))


## Long-term resident analyses

### Within-effects

##### Five years, controls plus
ggvote_plot_mfx2(
  ames_data = stayer_microm_ames,
  desc_data = stayer_microm_desc,
  model_ids = c(210, 225),
  add_descriptives = TRUE,
  d = "cmr_arm_cwu",
  x1  = "Homeownership",
  x2 = "log_hinc_eq",
  x2_continuous = TRUE,
  ytitle = "Marginal Effect",
  xtitle = "Log. Equivalized Household Income",
  font_size = 15L
) %>%
  ggsave(
    plot = .,
    filename = paste0("microm-afd-sup-own-inc-5-plus", "-1.pdf"),
    path = "fig",
    width = 8,
    height = 4,
    dpi = 300,
    limitsize = FALSE
  )

### Extra covariates
ggvote_plot_mfx2(
  ames_data = stayer_microm_ames,
  desc_data = stayer_microm_desc,
  model_ids = c(255),
  add_descriptives = TRUE,
  d = "cmr_arm_cwu",
  x2 = "log_hinc_eq",
  x1 = "gtyp3",
  x2_continuous = TRUE,
  ytitle = "Marginal Effect",
  xtitle = "Log. Equivalized Household Income",
  font_size = 15L
) %>%
  ggsave(
    plot = .,
    filename = paste0("microm-afd-sup-own-inc-loc-renter-5-plus", "-1.pdf"),
    path = "fig",
    width = 10,
    height = 4,
    dpi = 300,
    limitsize = FALSE
  )
